<template>
	<div class="bigBox" id="app">
		<div class="tabSwitch">
			<nav v-for="(item,index) in defaultArr" :class="currentIndex == index ? 'switchOn': ''"  @click="back(index)">{{item}}</nav>
			<nav class="determine">判定</nav>
		</div>
		<div class="bj">
	
			<!-- 计算转化分 -->
			<p class="calculate" v-if="status != 2" @click="calculateEvent ? calculate(): tips()">
				<image src="../../../static/img/monitor/tcm/calculateIcon@2x.png" alt="">
				计算转化分
			</p>
	
			<!-- 体质辨识得分 -->
			<p class="identification">
				<image src="../../../static/img/questionnaire/title@2x.png" alt="">
			</p>
	
			<table class="table">
				<tr>
					<td>体质类型</td>
					<td>转化分数</td>
					<td>分数对应</td>
				</tr>
				<tr v-if="!calculatePoints.appPhysiqueScoreEntitiesvo || calculatePoints.appPhysiqueScoreEntitiesvo.length <= 0" v-for="(item,index) in defaultArr">
					<td>{{item}}</td>
					<td></td>
					<td></td>
				</tr>
				<tr v-if="calculatePoints.appPhysiqueScoreEntitiesvo && calculatePoints.appPhysiqueScoreEntitiesvo.length > 0"  v-for="(item,index) in calculatePoints.appPhysiqueScoreEntitiesvo">
					<td>{{item.typeName}}</td>
					<td>{{item.score}}</td>
					<td>{{item.result}}</td>
				</tr>
			</table>
	
			<p class="userName">
				<span>转化人：<i>{{calculatePoints.userName || ''}}</i></span>
				<span>转化日期：
					<i>{{calculatePoints.createdDate}}</i>
				</span>
			</p>
			<!-- v-if="result.appConstitutionEntityVo && result.appConstitutionEntityVo.isAmended != 1 || result.appConstitution && result.appConstitution.type != 2 || !result.appConstitutionEntityVo && !result.appConstitution" -->
			<p class="tips"  v-if="result.appConstitution && result.appConstitution.type != 2">     
				此结果仅为通过问卷原始分计算出的个人各种体质的“转化分”。
				中医体质辨识的最终结果需要通过中医体质体检后得出结论。
				请联系您的健康管理师进行中医体检。                                  
			</p>
			
			 <!-- 体质辨识得分（修正后） -->	 
			<div class="correction">
				<div  v-if="result.appConstitutionEntityVo && result.appConstitutionEntityVo.isAmended == 2 && result.appConstitution && result.appConstitution.type == 2">
					<p class="identification">
						<image src="../../../static/img/questionnaire/title@2x.png" alt=""><span>(修正后)</span>
					</p>
							
					<table class="table">
						<tr>
							<td>体质类型</td>
							<td>转化分数</td>
							<td>分数对应</td>
						</tr>
						<tr v-if="!calculatePoints.appPhysiqueScoreEntitiesvo || calculatePoints.appPhysiqueScoreEntitiesvo.length <= 0" v-for="(item,index) in defaultArr">
							<td>{{item}}</td>
							<td></td>
							<td></td>
						</tr>
						<tr v-if="calculatePoints.appPhysiqueScoreEntitiesvo && calculatePoints.appPhysiqueScoreEntitiesvo.length > 0"  v-for="(item,index) in calculatePoints.appPhysiqueScoreEntitiesvo">
							<td>{{item.typeName}}</td>
							<td :style="{color:item.dissimilarity?'#f00':''}">{{item.healthScore}}</td>
							<td :style="{color:item.dissimilarity?'#f00':''}">{{item.healthResult}}</td>
						</tr>
					</table>
				</div>
		
				<p class="userName" v-if="result.appPhysiqueScoreEntitiesvo && result.appPhysiqueScoreEntitiesvo.isAmended == 2 || result.appConstitution && result.appConstitution.type == 2">
					<span>体检人：<i>{{calculatePoints.healthName}}</i></span>
					<span>体检日期：<i>{{calculatePoints.signDate}}</i></span>
				</p>
				
			</div>
			
			<p class="medical" v-if="result.appConstitution && result.appConstitution.type == 2" @click="medical">中医体检-望 闻 切详情<image src="../../../static/img/questionnaire/arrow.png" alt=""> </p>

			 <!-- 体质判定 -->
			<div class="constitutionDetermine" v-if="result.appConstitution && result.appConstitution.type == 2">
				<div class="constitutionDetermineTitle">
					<p>体</p>
					<p>质</p>
					<p>判</p>
					<p>定</p>
				</div>
				<div class="result" v-if="result.appConstitution && result.appConstitution.type == 2">
				<div v-if="constitution[1]">
						<span>为{{ constitution[0]}}体质<br></span>
						<span v-if="constitution[1]">以{{ constitution[1]}}为主<br></span>
						<span v-if="constitution[2]">兼{{constitution[2]}}体质<br></span>
						<span v-if="constitution[3]">有{{ constitution[3]}}倾向<br> </span> 
					</div>
					<div v-else>
						<span v-if="constitution[0]" style="font-size: 4.2vw;">为{{ constitution[0]}}体质<br></span>
						<br>
						<span v-if="constitution[3]" style="font-size: 4.2vw;">有{{ constitution[3]}}倾向<br></span>  
					</div>
				</div> 
			</div>

			<div class="operation" v-if="status != 2">
				<view class="page" @click="preserve(1)">保存</view>
				<view class="goList" @click="preserve(2)">确认存档</view>
				<p class="bottom"  v-if="result.appConstitution && result.appConstitution.type == 2"></p>
			</div>
		</div> 
		<u-modal v-model="showModal" :show-cancel-button="true" @confirm="Modalconfirm" :content="showContent"></u-modal>
	  
	</div>
</template>

<script src="@/static/js/monitor/tcm/syndrome.js"></script>

<style lang="scss" scoped>
	@import "@/static/css/monitor/tcm/syndrome.scss";
</style>
